import React, { Component } from "react";
import { connect } from "dva";
import { routerRedux } from "dva/router";
import { Row, Col, Card, Button, Input, message, Icon, } from "antd";
import styles from "./search.less";
import login from "@/assets/search/baoxian.jpg";

class Search extends Component {
	constructor(props) {
		super(props);
		this.state = {};
	}

	componentDidMount() {}
	
	nextRouter = (value) => {
		const { dispatch } = this.props;
		let pathname = "/searchResult";
		dispatch(routerRedux.push({ pathname, query: { content: value } }));
	}

	render() {

		return (
			<div className={styles.search}>
				<div style={{ margin: 24, display: 'inline-block' }}>
					<img src={login} height="36" />
				</div>
				<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: 'calc(100vh - 300px)' }}>
					<div style={{ minWidth: '720px', padding: '0 20px', margin: '0 auto' }}>
						<div
							style={{
								textAlign: 'center',
								fontSize: '48px',
								fontWeight: 'bold',
								color: '#000000',
								marginBottom: '32px',
							}}
						>知识门户</div>
						<Input.Search
							placeholder="输入保险名称、关键词或条款内容"
							enterButton="搜索"
							size="large"
							onSearch={value => this.nextRouter(value)}
						/>
						{/* <div style={{ background: '#FFF3DA', color: '#FFAA00', padding: '10px 14px', borderRadius: '8px', marginTop: 16 }}>
							因业务调整 magi.com 即日起暂停服务，如有需要请<span>联系我们</span>
						</div> */}
					</div>
				</div>
			</div>
		);
	}
}

export default connect()(Search);
